package web.member.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import web.member.vo.MemberVo;

@Controller
@RequestMapping("/member")
public class MemberController {

	@RequestMapping(value="/getMemberList", method=RequestMethod.GET)
	public ModelAndView getMemberList(String requestString){
		ModelAndView mav = new ModelAndView();
		List<MemberVo> listObject = null;
		
		listObject = new ArrayList<MemberVo>();
		
		try{
			MemberVo member1 = new MemberVo();
			member1.setUserName("tester1");
			member1.setUserHpNumber("010-1234-0001");
			listObject.add(member1);
			
//			MemberVo member2 = new MemberVo();
//			member2.setUserName("tester2");
//			member2.setUserHpNumber("010-1234-0002");
//			listObject.add(member2);
//			
//			MemberVo member3 = new MemberVo();
//			member3.setUserName("tester3");
//			member3.setUserHpNumber("010-1234-0003");
//			listObject.add(member3);
			
		}catch(Exception e){
			e.printStackTrace();
		}
		
		mav.addObject("listObject", listObject);
		mav.addObject("returnMessage", requestString);
		mav.setViewName("member/getMemberList");
		return mav;
	}
}
